<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册</title>
<script src="../../Public/Home/js/ymd.js" type="text/javascript"></script>
<script src="../../Public/Home/js/selarea.js" type="text/javascript"></script>
</head>

<body>
<a href="{U('Index/index')}">返回</a>
<form action="{U('UserCenter/register')}" method="post" name="fromRegister" onsubmit="return register(this)">
	手机:<input type="text" name="mobile_phone" placeholder="请输入手机号"><br>
	姓名:<input type="text" name="user_name" placeholder="请输入姓名"><br>
	性别:<input type="radio" name="sex" value="1" checked="checked" />男 <input type="radio" name="sex" value="0">女<br>
	生日:
		 <select name="bir_year" onChange="YYYYDD(this.value)">
	     <option value="">请选择 年</option>
	     </select>
	     <select name="bir_month" onChange="MMDD(this.value)">
	        <option value="">选择 月</option>
	     </select>
	     <select name="bir_day" onChange="DDD(this.value)">
	        <option value="">选择 日</option>
	     </select>
	<br>
	地址:
	<span id="province">
          <select name="province" onChange="selProvinces(document.fromRegister.province.options[document.fromRegister.province.selectedIndex].value);">
              <option value="" selected>请选择省份</option>
              {foreach from=$reg_list item=val}
              <option value="{$val.region_id}">{$val.region_name}</option>
              {/foreach}
          </select>
    </span>
    <span id="city">
    <select name="city" disabled><option value="" selected>请选择城市</option></select>
    </span>
    <span id="district">
    <select name="district" disabled><option value="" selected>请选择区域</option></select>
    </span><br>
	车牌:<input type="text" name="car_no" placeholder="请输入车牌号"><br>
	<input type="submit" name="act_register" value="注 册">
</form>
<script type="text/javascript">
	function register(form)
	{
		if(form.mobile_phone.value == "")
		{
			alert("请输入手机号码！");
			form.mobile_phone.select();
			return false;
		}
		if (form.mobile_phone.value.length>0)
		{
		    var reg = /^[\d|\-|\s]+$/;
		    if (!reg.test(form.mobile_phone.value))
		    {
		      alert("手机号码不是一个有效号码！");
		      form.mobile_phone.select();
			  return false;
		    }
		}
		if(form.user_name.value == "")
		{
			alert("请输入姓名！");
			form.user_name.select();
			return false;
		}
		if(form.car_no.value == "")
		{
			alert("请输入车牌号码！");
			form.car_no.select();
			return false;
		}
	}
</script>
</body>
</html>